Spree::Sample.load_sample("tax_categories")
Spree::Sample.load_sample("shipping_categories")

clothing = Spree::TaxCategory.find_by_name!("衣服")
shipping_category = Spree::ShippingCategory.find_by_name!("Default")

default_attrs = {
    description: FFaker::Lorem.paragraph,
    available_on: Time.zone.now
}

products = [
    {
        :name => "Ruby on Rails Tote",
        :tax_category => clothing,
        :shipping_category => shipping_category,
        :price => 15.99,
    },
]

Spree::Config[:currency] = "CNY"

products.each do |product_attrs|
  Spree::Product.create!(default_attrs.merge(product_attrs))
end